<?
   include("head.html.php");
?>

<!--
 ____________________________________________________________
|                                                            |
|    DESIGN + Pat Heard { http://fullahead.org }             |
|      DATE + 2006.03.19                                     |
| COPYRIGHT + Free use if this notice is left in place       |
|____________________________________________________________|

-->

<?
   global $strName, $hashPassword;

   if (!isset($_SESSION['sessData']["loggedin"]) || ($_SESSION['sessData']["loggedin"] == 0))
   {
      // not logged in 

      if (isset($_REQUEST["username"]) && isset($_REQUEST["password"]))
      {
         $strName = $_REQUEST["username"];
         $hashPassword = $_REQUEST["password"];

         if ($strName != "")
         {
            $_SESSION['sessData']["loggedin"] = authenticate($strName, $hashPassword); 
            $_SESSION['sessData']["username"] = $strName;
            $_SESSION['sessData']["password"] = $password;
         }
         else { $_SESSION['sessData']["loggedin"] = 0; }
      }
      else { $_SESSION['sessData']["loggedin"] = 0; }
   }
?>

<!-- CONTENT: Holds all site content except for the footer.  This is what causes the footer to stick to the bottom -->
<div id="content">

<?
	$here = "play";
   include("header.html.php");
   include("topmenu.php");
   //printTopMenu();
?>

  <!-- PAGE CONTENT BEGINS: This is where you would define the columns 
       (number, width and alignment) -->
  <div id="page">

<?php
   include("login.html.php");
?>

    <!-- 75 percent width column, aligned to the right -->
    <div class="width75 floatRight">

<?php
   if ($_SESSION['sessData']["loggedin"] == 1)
   {
      //print "<applet code=frontend/MainApplet.class width=800 height=600>\n";
     // print "  <param name=\"username\" value=\"". $_SESSION['sessData']["username"] . "\">\n";
      //print "</applet>\n";
   }
   else
   {
      print "<br><br><font size=5>";
      print "You must be logged in to play!<br><br>\n";
      print "Please login first. \n";
      print "</font>\n";
   }
?>

    </div>
  </div>

</div>

<?php
   include("footer.html.php");
?>

